home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / PInterfaces / IntlResources.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  13.6 KB  |  365 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        IntlResources.p
  3.  
  4.      Contains:    International Resource definitions.
  5.  
  6.      Version:    Technology:    System 7.5+
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1983-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT IntlResources;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __INTLRESOURCES__}
  27. {$SETC __INTLRESOURCES__ := 1}
  28.  
  29. {$I+}
  30. {$SETC IntlResourcesIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __MACTYPES__}
  34. {$I MacTypes.p}
  35. {$ENDC}
  36.  
  37.  
  38. {$PUSH}
  39. {$ALIGN MAC68K}
  40. {$LibExport+}
  41.  
  42.  
  43. CONST
  44.                                                                 {  Bits in the itlcFlags byte  }
  45.     itlcShowIcon                = 7;                            { Show icon even if only one script }
  46.     itlcDualCaret                = 6;                            { Use dual caret for mixed direction text }
  47.                                                                 {  Bits in the itlcSysFlags word  }
  48.     itlcSysDirection            = 15;                            { System direction - left to right/right to left }
  49.  
  50.                                                                 {  One more flag in the itlcFlags byte  }
  51.     itlcDisableKeyScriptSync    = 3;                            { Disable font and keyboard script synchrinozation }
  52.  
  53.                                                                 {  We should define masks, too.  }
  54.     itlcDisableKeyScriptSyncMask = $08;                            { Disable font and keyboard script synchrinozation mask }
  55.  
  56.  
  57.     tokLeftQuote                = 1;                            {  NumberParts.data[] enumerators                                              }
  58.     tokRightQuote                = 2;                            {   In general, these are NOT to be considered indices into the data[] array  }
  59.     tokLeadPlacer                = 3;
  60.     tokLeader                    = 4;
  61.     tokNonLeader                = 5;
  62.     tokZeroLead                    = 6;
  63.     tokPercent                    = 7;
  64.     tokPlusSign                    = 8;
  65.     tokMinusSign                = 9;
  66.     tokThousands                = 10;
  67.     tokReserved                    = 11;                            {  11 is reserved field  }
  68.     tokSeparator                = 12;
  69.     tokEscape                    = 13;
  70.     tokDecPoint                    = 14;
  71.     tokEPlus                    = 15;
  72.     tokEMinus                    = 16;
  73.     tokMaxSymbols                = 31;
  74.     curNumberPartsVersion        = 1;                            { current version of NumberParts record }
  75.  
  76.     currSymLead                    = 16;
  77.     currNegSym                    = 32;
  78.     currTrailingZ                = 64;
  79.     currLeadingZ                = 128;
  80.  
  81.     mdy                            = 0;
  82.     dmy                            = 1;
  83.     ymd                            = 2;
  84.     myd                            = 3;
  85.     dym                            = 4;
  86.     ydm                            = 5;
  87.  
  88.  
  89. TYPE
  90.     DateOrders                            = SInt8;
  91.  
  92. CONST
  93.     timeCycle24                    = 0;                            { time sequence 0:00 - 23:59 }
  94.     timeCycleZero                = 1;                            { time sequence 0:00-11:59, 0:00 - 11:59 }
  95.     timeCycle12                    = 255;                            { time sequence 12:00 - 11:59, 12:00 - 11:59 }
  96.     zeroCycle                    = 1;                            { old name for timeCycleZero }
  97.     longDay                        = 0;                            { day of the month }
  98.     longWeek                    = 1;                            { day of the week }
  99.     longMonth                    = 2;                            { month of the year }
  100.     longYear                    = 3;                            { year }
  101.     supDay                        = 1;                            { suppress day of month }
  102.     supWeek                        = 2;                            { suppress day of week }
  103.     supMonth                    = 4;                            { suppress month }
  104.     supYear                        = 8;                            { suppress year }
  105.     dayLdingZ                    = 32;
  106.     mntLdingZ                    = 64;
  107.     century                        = 128;
  108.     secLeadingZ                    = 32;
  109.     minLeadingZ                    = 64;
  110.     hrLeadingZ                    = 128;
  111.  
  112. { move OffsetTable to QuickdrawText }
  113.  
  114. TYPE
  115.     Intl0RecPtr = ^Intl0Rec;
  116.     Intl0Rec = PACKED RECORD
  117.         decimalPt:                CHAR;                                    { decimal point character }
  118.         thousSep:                CHAR;                                    { thousands separator character }
  119.         listSep:                CHAR;                                    { list separator character }
  120.         currSym1:                CHAR;                                    { currency symbol }
  121.         currSym2:                CHAR;
  122.         currSym3:                CHAR;
  123.         currFmt:                UInt8;                                    { currency format flags }
  124.         dateOrder:                UInt8;                                    { order of short date elements: mdy, dmy, etc. }
  125.         shrtDateFmt:            UInt8;                                    { format flags for each short date element }
  126.         dateSep:                CHAR;                                    { date separator character }
  127.         timeCycle:                UInt8;                                    { specifies time cycle: 0..23, 1..12, or 0..11 }
  128.         timeFmt:                UInt8;                                    { format flags for each time element }
  129.         mornStr:                PACKED ARRAY [1..4] OF CHAR;            { trailing string for AM if 12-hour cycle }
  130.         eveStr:                    PACKED ARRAY [1..4] OF CHAR;            { trailing string for PM if 12-hour cycle }
  131.         timeSep:                CHAR;                                    { time separator character }
  132.         time1Suff:                CHAR;                                    { trailing string for AM if 24-hour cycle }
  133.         time2Suff:                CHAR;
  134.         time3Suff:                CHAR;
  135.         time4Suff:                CHAR;
  136.         time5Suff:                CHAR;                                    { trailing string for PM if 24-hour cycle }
  137.         time6Suff:                CHAR;
  138.         time7Suff:                CHAR;
  139.         time8Suff:                CHAR;
  140.         metricSys:                UInt8;                                    { 255 if metric, 0 if inches etc. }
  141.         intl0Vers:                INTEGER;                                { region code (hi byte) and version (lo byte) }
  142.     END;
  143.  
  144.     Intl0Ptr                            = ^Intl0Rec;
  145.     Intl0Hndl                            = ^Intl0Ptr;
  146.     Intl1RecPtr = ^Intl1Rec;
  147.     Intl1Rec = PACKED RECORD
  148.         days:                    ARRAY [1..7] OF Str15;                    { day names }
  149.         months:                    ARRAY [1..12] OF Str15;                    { month names }
  150.         suppressDay:            UInt8;                                    { 255 for no day, or flags to suppress any element }
  151.         lngDateFmt:                UInt8;                                    { order of long date elements }
  152.         dayLeading0:            UInt8;                                    { 255 for leading 0 in day number }
  153.         abbrLen:                UInt8;                                    { length for abbreviating names }
  154.         st0:                    PACKED ARRAY [1..4] OF CHAR;            { separator strings for long date format }
  155.         st1:                    PACKED ARRAY [1..4] OF CHAR;
  156.         st2:                    PACKED ARRAY [1..4] OF CHAR;
  157.         st3:                    PACKED ARRAY [1..4] OF CHAR;
  158.         st4:                    PACKED ARRAY [1..4] OF CHAR;
  159.         intl1Vers:                INTEGER;                                { region code (hi byte) and version (lo byte) }
  160.         localRtn:                ARRAY [0..0] OF INTEGER;                { now a flag for opt extension }
  161.     END;
  162.  
  163.     Intl1Ptr                            = ^Intl1Rec;
  164.     Intl1Hndl                            = ^Intl1Ptr;
  165. {fields for optional itl1 extension}
  166.     Itl1ExtRecPtr = ^Itl1ExtRec;
  167.     Itl1ExtRec = RECORD
  168.         base:                    Intl1Rec;                                { un-extended Intl1Rec }
  169.         version:                INTEGER;
  170.         format:                    INTEGER;
  171.         calendarCode:            INTEGER;                                { calendar code for this itl1 resource }
  172.         extraDaysTableOffset:    LONGINT;                                { offset in itl1 to extra days table }
  173.         extraDaysTableLength:    LONGINT;                                { length of extra days table }
  174.         extraMonthsTableOffset:    LONGINT;                                { offset in itl1 to extra months table }
  175.         extraMonthsTableLength:    LONGINT;                                { length of extra months table }
  176.         abbrevDaysTableOffset:    LONGINT;                                { offset in itl1 to abbrev days table }
  177.         abbrevDaysTableLength:    LONGINT;                                { length of abbrev days table }
  178.         abbrevMonthsTableOffset: LONGINT;                                { offset in itl1 to abbrev months table }
  179.         abbrevMonthsTableLength: LONGINT;                                { length of abbrev months table }
  180.         extraSepsTableOffset:    LONGINT;                                { offset in itl1 to extra seps table }
  181.         extraSepsTableLength:    LONGINT;                                { length of extra seps table }
  182.         tables:                    ARRAY [0..0] OF INTEGER;                { now a flag for opt extension }
  183.     END;
  184.  
  185.     UntokenTablePtr = ^UntokenTable;
  186.     UntokenTable = RECORD
  187.         len:                    INTEGER;
  188.         lastToken:                INTEGER;
  189.         index:                    ARRAY [0..255] OF INTEGER;                { index table; last = lastToken }
  190.     END;
  191.  
  192.     UntokenTableHandle                    = ^UntokenTablePtr;
  193.     WideCharPtr = ^WideChar;
  194.     WideChar = RECORD
  195.         CASE INTEGER OF
  196.         0: (
  197.             a:                    PACKED ARRAY [0..1] OF CHAR;            { 0 is the high order character }
  198.             );
  199.         1: (
  200.             b:                    INTEGER;
  201.             );
  202.     END;
  203.  
  204.     WideCharArrPtr = ^WideCharArr;
  205.     WideCharArr = RECORD
  206.         size:                    INTEGER;
  207.         data:                    ARRAY [0..9] OF WideChar;
  208.     END;
  209.  
  210.     NumberPartsPtr = ^NumberParts;
  211.     NumberParts = RECORD
  212.         version:                INTEGER;
  213.         data:                    ARRAY [0..30] OF WideChar;                { index by [tokLeftQuote..tokMaxSymbols] }
  214.         pePlus:                    WideCharArr;
  215.         peMinus:                WideCharArr;
  216.         peMinusPlus:            WideCharArr;
  217.         altNumTable:            WideCharArr;
  218.         reserved:                PACKED ARRAY [0..19] OF CHAR;
  219.     END;
  220.  
  221.  
  222.     Itl4RecPtr = ^Itl4Rec;
  223.     Itl4Rec = RECORD
  224.         flags:                    INTEGER;                                { reserved }
  225.         resourceType:            LONGINT;                                { contains 'itl4' }
  226.         resourceNum:            INTEGER;                                { resource ID }
  227.         version:                INTEGER;                                { version number }
  228.         resHeader1:                LONGINT;                                { reserved }
  229.         resHeader2:                LONGINT;                                { reserved }
  230.         numTables:                INTEGER;                                { number of tables, one-based }
  231.         mapOffset:                LONGINT;                                { offset to table that maps byte to token }
  232.         strOffset:                LONGINT;                                { offset to routine that copies canonical string }
  233.         fetchOffset:            LONGINT;                                { offset to routine that gets next byte of character }
  234.         unTokenOffset:            LONGINT;                                { offset to table that maps token to canonical string }
  235.         defPartsOffset:            LONGINT;                                { offset to default number parts table }
  236.         resOffset6:                LONGINT;                                { reserved }
  237.         resOffset7:                LONGINT;                                { reserved }
  238.         resOffset8:                LONGINT;                                { reserved }
  239.     END;
  240.  
  241.     Itl4Ptr                                = ^Itl4Rec;
  242.     Itl4Handle                            = ^Itl4Ptr;
  243. { New NItl4Rec for System 7.0: }
  244.     NItl4RecPtr = ^NItl4Rec;
  245.     NItl4Rec = RECORD
  246.         flags:                    INTEGER;                                { reserved }
  247.         resourceType:            LONGINT;                                { contains 'itl4' }
  248.         resourceNum:            INTEGER;                                { resource ID }
  249.         version:                INTEGER;                                { version number }
  250.         format:                    INTEGER;                                { format code }
  251.         resHeader:                INTEGER;                                { reserved }
  252.         resHeader2:                LONGINT;                                { reserved }
  253.         numTables:                INTEGER;                                { number of tables, one-based }
  254.         mapOffset:                LONGINT;                                { offset to table that maps byte to token }
  255.         strOffset:                LONGINT;                                { offset to routine that copies canonical string }
  256.         fetchOffset:            LONGINT;                                { offset to routine that gets next byte of character }
  257.         unTokenOffset:            LONGINT;                                { offset to table that maps token to canonical string }
  258.         defPartsOffset:            LONGINT;                                { offset to default number parts table }
  259.         whtSpListOffset:        LONGINT;                                { offset to white space code list }
  260.         resOffset7:                LONGINT;                                { reserved }
  261.         resOffset8:                LONGINT;                                { reserved }
  262.         resLength1:                INTEGER;                                { reserved }
  263.         resLength2:                INTEGER;                                { reserved }
  264.         resLength3:                INTEGER;                                { reserved }
  265.         unTokenLength:            INTEGER;                                { length of untoken table }
  266.         defPartsLength:            INTEGER;                                { length of default number parts table }
  267.         whtSpListLength:        INTEGER;                                { length of white space code list }
  268.         resLength7:                INTEGER;                                { reserved }
  269.         resLength8:                INTEGER;                                { reserved }
  270.     END;
  271.  
  272.     NItl4Ptr                            = ^NItl4Rec;
  273.     NItl4Handle                            = ^NItl4Ptr;
  274.  
  275.     TableDirectoryRecordPtr = ^TableDirectoryRecord;
  276.     TableDirectoryRecord = RECORD
  277.         tableSignature:            OSType;                                    { 4 byte long table name  }
  278.         reserved:                UInt32;                                    { Reserved for internal use  }
  279.         tableStartOffset:        UInt32;                                    { Table start offset in byte }
  280.         tableSize:                UInt32;                                    { Table size in byte }
  281.     END;
  282.  
  283.     Itl5RecordPtr = ^Itl5Record;
  284.     Itl5Record = RECORD
  285.         versionNumber:            Fixed;                                    { itl5 resource version number  }
  286.         numberOfTables:            UInt16;                                    { Number of tables it contains  }
  287.         reserved:                ARRAY [0..2] OF UInt16;                    { Reserved for internal use  }
  288.         tableDirectory:            ARRAY [0..0] OF TableDirectoryRecord;    { Table directory records  }
  289.     END;
  290.  
  291.     RuleBasedTrslRecordPtr = ^RuleBasedTrslRecord;
  292.     RuleBasedTrslRecord = RECORD
  293.         sourceType:                INTEGER;                                { Transliterate target type for the LHS of the rule  }
  294.         targetType:                INTEGER;                                { Transliterate target type for the RHS of the rule  }
  295.         formatNumber:            INTEGER;                                { Transliterate resource format number  }
  296.         propertyFlag:            INTEGER;                                { Transliterate property flags  }
  297.         numberOfRules:            INTEGER;                                { Number of rules following this field  }
  298.     END;
  299.  
  300.  
  301.     ItlcRecordPtr = ^ItlcRecord;
  302.     ItlcRecord = RECORD
  303.         itlcSystem:                INTEGER;                                { default system script }
  304.         itlcReserved:            INTEGER;                                { reserved }
  305.         itlcFontForce:            SInt8;                                    { default font force flag }
  306.         itlcIntlForce:            SInt8;                                    { default intl force flag }
  307.         itlcOldKybd:            SInt8;                                    { MacPlus intl keybd flag }
  308.         itlcFlags:                SInt8;                                    { general flags }
  309.         itlcIconOffset:            INTEGER;                                { keyboard icon offset; not used in 7.0 }
  310.         itlcIconSide:            SInt8;                                    { keyboard icon side; not used in 7.0 }
  311.         itlcIconRsvd:            SInt8;                                    { rsvd for other icon info }
  312.         itlcRegionCode:            INTEGER;                                { preferred verXxx code }
  313.         itlcSysFlags:            INTEGER;                                { flags for setting system globals }
  314.         itlcReserved4:            ARRAY [0..31] OF SInt8;                    { for future use }
  315.     END;
  316.  
  317.     ItlbRecordPtr = ^ItlbRecord;
  318.     ItlbRecord = RECORD
  319.         itlbNumber:                INTEGER;                                { itl0 id number }
  320.         itlbDate:                INTEGER;                                { itl1 id number }
  321.         itlbSort:                INTEGER;                                { itl2 id number }
  322.         itlbFlags:                INTEGER;                                { Script flags }
  323.         itlbToken:                INTEGER;                                { itl4 id number }
  324.         itlbEncoding:            INTEGER;                                { itl5 ID # (optional; char encoding) }
  325.         itlbLang:                INTEGER;                                { current language for script  }
  326.         itlbNumRep:                SInt8;                                    { number representation code }
  327.         itlbDateRep:            SInt8;                                    { date representation code  }
  328.         itlbKeys:                INTEGER;                                { KCHR id number }
  329.         itlbIcon:                INTEGER;                                { ID # of SICN or kcs#/kcs4/kcs8 suite. }
  330.     END;
  331.  
  332. { New ItlbExtRecord structure for System 7.0 }
  333.     ItlbExtRecordPtr = ^ItlbExtRecord;
  334.     ItlbExtRecord = PACKED RECORD
  335.         base:                    ItlbRecord;                                { un-extended ItlbRecord }
  336.         itlbLocalSize:            LONGINT;                                { size of script's local record }
  337.         itlbMonoFond:            INTEGER;                                { default monospace FOND ID }
  338.         itlbMonoSize:            INTEGER;                                { default monospace font size }
  339.         itlbPrefFond:            INTEGER;                                { preferred FOND ID }
  340.         itlbPrefSize:            INTEGER;                                { preferred font size }
  341.         itlbSmallFond:            INTEGER;                                { default small FOND ID }
  342.         itlbSmallSize:            INTEGER;                                { default small font size }
  343.         itlbSysFond:            INTEGER;                                { default system FOND ID }
  344.         itlbSysSize:            INTEGER;                                { default system font size }
  345.         itlbAppFond:            INTEGER;                                { default application FOND ID }
  346.         itlbAppSize:            INTEGER;                                { default application font size }
  347.         itlbHelpFond:            INTEGER;                                { default Help Mgr FOND ID }
  348.         itlbHelpSize:            INTEGER;                                { default Help Mgr font size }
  349.         itlbValidStyles:        Style;                                    { set of valid styles for script }
  350.         itlbAliasStyle:            Style;                                    { style (set) to mark aliases }
  351.     END;
  352.  
  353.  
  354.  
  355. {$ALIGN RESET}
  356. {$POP}
  357.  
  358. {$SETC UsingIncludes := IntlResourcesIncludes}
  359.  
  360. {$ENDC} {__INTLRESOURCES__}
  361.  
  362. {$IFC NOT UsingIncludes}
  363.  END.
  364. {$ENDC}
  365.